@echo off
echo Building for Windows...

:: 创建构建目录
if not exist build mkdir build
cd build

:: 设置 WebView2 SDK 路径
set WEBVIEW2_SDK=..\lib\WebView2

:: 编译库文件
cl.exe /c ..\src\win_webview.c ^
    /I..\include ^
    /I%WEBVIEW2_SDK%\include ^
    /Fowin_webview.obj

:: 创建静态库
lib.exe /OUT:webview.lib win_webview.obj

:: 编译示例程序
cl.exe ..\example\main.c ^
    /I..\include ^
    webview.lib ^
    %WEBVIEW2_SDK%\lib\WebView2Loader.dll.lib ^
    /Feexample.exe

:: 复制HTML文件到构建目录
copy ..\example\index.html .

echo Build completed. Run example.exe to start the application.
cd .. 